package com.ace.explore.users.service;

import akka.actor.AbstractActor;
import com.ace.explore.users.model.UserBasicInfo;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;

/**
 * Created by zhangwanli on 2017/9/12.
 */
@Service
public class UserBasicInfoServiceImpl extends AbstractActor implements UserBasicInfoService {

    private UserBasicInfoService self = (UserBasicInfoService) AopContext.currentProxy();

    @Override
    public Receive createReceive() {
        return receiveBuilder()
                .match(String.class, userName -> getSender().tell(self.queryUserByUserName(userName), getSelf()))
                .match(Long.class, userId -> getSender().tell(self.queryUserById(userId), getSelf()))
                .build();
    }

    @Override
    public UserBasicInfo queryUserByUserName(String userName) {
        return null;
    }

    @Override
    public UserBasicInfo queryUserById(Long userId) {
        return null;
    }

}
